home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
PredatorPrey
/
Globals.h
< prev
next >
Wrap
Text File
|
1996-06-22
|
5KB
|
208 lines
/* Globals.h */ /* C14 Calculator */
#ifndef __GLO__
#define __GLO__
#define ProcHelp 2
#ifndef _H_Globals
#define _H_Globals
#ifdef _DECLAIR
#define EXTERN
#else
#define EXTERN extern
#endif
struct matdscr
{
short row;
short col;
short firstreg;
};
extern struct matdscr matA, matB, matC, matD, matE;
struct stkstrk
{
double_t real;
double_t imag;
char whichmat; /* 0x00 = 00000000 = none */
/* 0x01 = 00000001 = A */
/* 0x02 = 00000010 = B */
/* 0x03 = 00000011 = C */
/* 0x04 = 00000100 = D */
/* 0x05 = 00000101 = E */
};
extern struct stkstrk stk1, stk2, stk3, stk4, lastx, tempstrk/*, spare*/;
struct runstrk
{
char pos1;
char pos2;
char pos3;
char pos4;
char number;
char pStr[13];
};
extern struct runstrk run[449];
struct regstrk
{
double_t real;
char whichmat;
}; /* no storage allocated */
extern struct regstrk reg[66], *whichRegn, *whichReg0n;
typedef struct
{
Str255 ownerName;
Str255 ownerOrg;
Str255 ownerRegNo;
Str255 SUName;
Str255 SUPassword;
Str255 mem1name;
Str255 mem2name;
Str255 mem3name;
Str255 mem4name;
Str255 mem5name;
struct matdscr matA;
struct matdscr matB;
struct matdscr matC;
struct matdscr matD;
struct matdscr matE;
short memstat; /* number of registers used as registers, 20 originally */
short regstat; /* number of registers available */
short memcom; /* memory registers committed to matrix elements */
struct stkstrk stk5;
struct stkstrk stk4;
struct stkstrk stk3;
struct stkstrk stk2;
struct stkstrk stk1;
struct regstrk regIn; /* new Index Register */
struct regstrk reg[66];
struct stkstrk lastx;
struct stkstrk tempstrk;
long gFlagState;
short gDigits;
Boolean gUser;
short gResultMatrix;
} mapstruct; /* storage IS allocated for mapstruct */
EXTERN mapstruct map;
typedef struct
{
long PC;
long tPC;
short SP;
short END;
short rtnStk[7];
struct runstrk run[449];
short breakout;
Boolean stop;
} frogstruct;
EXTERN frogstruct frog;
typedef struct {
/* Standard fields: */
TEHandle text;
ControlHandle vScroll;
ControlHandle hScroll;
short fileNum;
short pFileNum;
short qFileNum;
short volNum;
Boolean dirty;
Boolean pDirty;
Boolean qDirty;
StringHandle filename;
StringHandle pFilename; /* program filename */
StringHandle qFilename; /* data filename */
enum {noWindow, WMainWindow, WHelp, WProgramWindow, WErrorWindow, WTextWindow, WRun} windowKind;
Handle witlHandle; /* Window itemlist resource */
Handle wictHandle; /* Window item color table resource */
/* Application-specific fields: */
/* for MainWindow: */
/* mapstruct map;*/
/* frogstruct frog;*/
/* for Help: */
ListHandle List1HandleHelp;;
short List1ChoiceHelp;
TEHandle Field2Handle;
ControlHandle Scroll3Handle;
/* for ProgramWindow: */
ListHandle List1HandleProgramWindow;
short List1ChoiceProgramWindow;
ListHandle List2HandleProgramWindow;
short List2ChoiceProgramWindow;
ListHandle List3HandleProgramWindow;
short List3ChoiceProgramWindow;
/* for ErrorWindow: */
TEHandle Field3Handle;
/* for Run: */
;
} WinInfoRec, *WinInfoPtr;
typedef struct {
Boolean hasGestalt; /* has Gestalt manager */
Boolean hasWNE; /* has WaitNextEvent */
Boolean hasColorQD; /* has Color QuickDraw */
Boolean hasAppleEvents; /* has Apple Events */
Boolean hasEditionMgr; /* has Edition Manager */
} SysConfigRec;
/* Standard vars: */
extern Boolean quittingTime;
extern short kkk; /* to accomodate Chuck Hoffmann's use of globals */
extern EventRecord curEvent;
extern WindowPtr curWindow;
extern WindowPtr altCurWindow;
extern WinInfoPtr cur;
extern WinInfoPtr altCur;
extern Boolean inBackground;
extern SysConfigRec sysConfig;
extern long helpLong; /* for help facility */
extern short helpPrev; /* previously selected help item */
extern short myMouseWhere; /* location (not Point) of mouse */
extern short WorkRetCode; /* work return code */
extern WindowPtr workWindowPtr; /* pointer from FindWindow */
extern long worklong; /* work variable */
extern RgnHandle workRegionH; /* work handle for TE redraw */
extern Rect destRect; /* for calculations of TE areas */
extern short windSub; /* subscript for window table */
extern Point helpCell; /* cell for List Manager */
extern Rect workRect; /* work variable */
/* Application-specific vars: */
/*----------*/
void GlobalsSeg (void);
void InitGlobals (void);
void SetInfo (WindowPtr window);
/*void SetSaveInfo (WindowPtr window);*/
void SetNewInfo (WindowPtr window);
/*void SetAltInfo (WindowPtr window);*/
void DiscardInfo (WindowPtr window);
#endif /* _H_Globals */
#endif /* __GLO__ */
/* Globals */